/*
 * Drawable1DInterface.cpp
 *
 *  Created on: Jul 1, 2009
 *      Author: kurt
 */

#include "Drawable1DInterface.h"
#include "DrawingCanvas.h"
#include <sstream>
using namespace std;
using namespace objdraw;

Drawable1DInterface::~Drawable1DInterface() 
{
	
}
Drawable1DInterface::Drawable1DInterface(const Drawable1DInterface & r)
{
	start = r.start;
	end = r.end;
	color = r.color;
	hidden = r.hidden;
	canvas = r.canvas;
	if(canvas != NULL)
		canvas->getCanvasContent().addDrawable(this);
}
Drawable1DInterface::Drawable1DInterface() 
{
	start = end = Location(0,0);
	color = Color(0,0,0);
	hidden = false;
	canvas = NULL;
}
Location Drawable1DInterface::getEnd() 
{
	return end; 
}
Location Drawable1DInterface::getStart() 
{ 
	return start; 
}
void Drawable1DInterface::setEnd(float x, float y) 
{ 
	setEnd(Location(x,y));
}
void Drawable1DInterface::setEnd(Location _end) 
{ 
	end = _end; 
}
void Drawable1DInterface::setEndPoints(float x1, float y1, float x2, float y2)
{
	start.moveTo(x1,y1);
	end.moveTo(x2,y2);
}
void Drawable1DInterface::setEndPoints(Location _start, Location _end)
{
	start = _start;
	end = _end;
}
void Drawable1DInterface::setStart(float x, float y) 
{ 
	start.moveTo(x,y);
}
void Drawable1DInterface::setStart(Location _start) 
{ 
	start = _start;
}
void Drawable1DInterface::render()
{
	
}
string Drawable1DInterface::toString()
{
	stringstream rstr("Drawable1DInterface: ");
	rstr << "start: " << start.toString() << 
	"end: " << end.toString() << 
	"color: " << color.toString() <<
	"hidden: " << hidden;
	return rstr.str();
}
